package cn.lp207663436.dynamicmanager.pojo.enumerate;

import org.apache.commons.lang3.StringUtils;

/**
 * @author lby
 * @version 1.0
 * @description: TODO
 * @date 2020/4/4 15:21
 */
public enum  SortEnum {

    /**
     * 倒叙
     */
    DESC("DESC","DESC"),
    /**
     * 正序
     */
    ASC("ASC","ASC");

    private String name;
    private String describl;

    SortEnum(String name, String describl) {
        this.name = name;
        this.describl = describl;
    }

    public static String getName(String describl) {
        for (SortEnum sortEnum : SortEnum.values()) {
            if (StringUtils.equals(sortEnum.getDescribl(),describl)) {
                return sortEnum.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescribl() {
        return describl;
    }

    public void setDescribl(String describl) {
        this.describl = describl;
    }
}
